package com.zhangjm.fegin;

import com.zhangjm.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "service-user")
public interface UserFeginClient {

    /**
     * 根据用户Id，查询用户名称
     * @param id
     * @return
     */
    @RequestMapping("/user/getUsernameById")
    public String getUsernameById(@RequestParam("id") Integer id);

    /**
     * 根据用户id，查询用户信息
     * @param id
     * @return
     */
    @RequestMapping("/user/getById")
    public User getById(@RequestParam("id") Integer id);
}
